package com.jay.service.impl;


import com.alipay.jarslink.api.Module;
import com.alipay.jarslink.api.ModuleConfig;
import com.alipay.jarslink.api.ModuleManager;
import com.jay.service.BindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BindServiceImpl implements BindService {

	@Autowired
	private ModuleManager moduleManager;

	@Override
	public String getResponse(String app) throws Exception {
		Module findModule = moduleManager.find(app);
		//查找和执行Action
		ModuleConfig moduleConfig = new ModuleConfig();
		moduleConfig.setName("h");
		moduleConfig.setEnabled(true);
		ModuleConfig result = findModule.doAction(app, moduleConfig);
		return result.getName();
	}
}
